/*
 * Copyright 2002-2005 the original author or authors.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package springfixture;

import fitnesse.fixtures.TableFixture;

/**
 * This class is used to set the Spring configuration for a Fitnesse page.
 * You add a table with this fixture to a Fitnesse page and define the
 * file names of all Spring configuration files.
 */
public class SpringConfig extends TableFixture {

    /**
     * Set the current ApplicationContext in the ApplicationContextHolder.
     * @param the number of rows
     */
    protected void doStaticTable(int rows) {
        String[] configLocation=new String[rows]; 
        for (int i=0; i<rows; i++) {
            configLocation[i]=getText(i,0);
        }
        ApplicationContextHolder.getApplicationContextHolder().setConfigLocation(configLocation);
    }

}
